package com.thf.service.impl;

import com.thf.dao.EchartsOneExcelUploadDao;
import com.thf.model.EchartsOneModel;
import com.thf.model.ResultData;
import com.thf.service.EchartsOneExcelUploadService;
import com.thf.util.ResultTool;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class EchartsOneExcelUploadServiceImpl implements EchartsOneExcelUploadService {

    @Resource
    private EchartsOneExcelUploadDao echartsOneExcelUploadDao;
    @Override
    public ResultData insertAll(List<EchartsOneModel> list) {
        for (EchartsOneModel echartsOneModel:list) {
            Integer integer = echartsOneExcelUploadDao.insertAll(echartsOneModel);
            if(integer<=0){
                return new ResultData(ResultTool.CODE_ERROR);
            }
        }
        return new ResultData(ResultTool.CODE_SUCCES);
    }
}
